//package com.lill.common.component.medal;
//
//import net.sf.json.JSONObject;
//
//import org.apache.commons.lang.StringUtils;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.AfterReturning;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.Async;
//
//@Aspect
//@Configuration
//public class MedalRealTimeAspect {
//
//	protected static Logger log = LoggerFactory.getLogger(MedalRealTimeAspect.class);
//
//	@Autowired(required = false)
//	private IMedalRealTimeService medalRealTimeService;
//
//	@Pointcut("execution(* com.lill.crm.customer.dao.*.*(..))"
//			+ " || execution(* com.lill.sale.dao.*.*(..))")
//	public void apiParamsPointcut() {
//	}
//
//	@AfterReturning(pointcut = "apiParamsPointcut()")
//	public void doAfterReturning(JoinPoint joinPoint) {
//		try {
//			if (null != medalRealTimeService) {
//				medalRealTimeHandle(joinPoint.getArgs(),joinPoint.getSignature().getName(), joinPoint.getSignature().getDeclaringTypeName(), joinPoint.getTarget().getClass().getInterfaces());
//			}
//		} catch (Exception e) {
//			log.error(e.getMessage());
//		}
//	}
//
//	@Async
//	private void medalRealTimeHandle(Object[] objArgs,String methodName, String InterfaceName,Class<?>[] classList) {
//		for (int i = 0; i < classList.length; i++) {
//			if (classList[i].getName().startsWith("com.lill.")) {
//				InterfaceName = classList[i].getName();
//				break;
//			}
//		}
//		StringBuffer menthName = new StringBuffer();
//		menthName.append(InterfaceName);
//		menthName.append(".");
//		menthName.append(methodName);
//		
//		if(null!=objArgs&&objArgs.length>0&&null!=objArgs[0]){
//			Object id=JSONObject.fromObject(objArgs[0]).get("id");
//			if(null!=id&&StringUtils.isNotEmpty(id.toString())){
//				medalRealTimeService.getRealTimeMedal(menthName.toString(),id);
//			}
//		}
//	}
//}
